package cn.xaut.数组;

public class demo344 {

    public void reverseString(char[] s) {

        int len = s.length;
        int l = 0, r = len - 1;
        while (r > l) {
            char t = s[l];
            s[l] = s[r];
            s[r] = t;
            l ++;
            r --;
        }
    }

    public static void main(String[] args) {

        char[] cs = new char[]{'h', 'e', 'l', 'l', 'o'};
        new demo344().reverseString(cs);
        System.out.println(cs);
    }
}
